
public class Block {
	String lb;
	Statements sts;
	String rb;
	
	public Block ( String lb, Statements sts, String rb){
		this.lb= lb;
		this.sts = sts;
		this.rb = rb;
	}
	public String toString(){
		String ret = "Block\n";

		String s = "";

		if (sts != null) {
			s +=  sts.toString();
		}

		for(String st: s.split("\n")){
			
			if(st!= "")
				ret += "| " + st + "\n";
		}

		return ret;
	}
	public void check() throws SemanticException {
		SymbolTable table = SymbolTable.getInstance();
		if (lb != null) {
			table.openScope();
		}
		if (sts != null) {
			sts.check();
		}
		if (rb != null) {
			table.closeScope();
		}
	}
}
